import { FORMTYPEDATA } from "../../../type";

export interface InputComponentProps {
  modelValue?: number | string | null;
  type?: string;
  maxlength?: string | number;
  minlength?: string | number;
  showWordLimit?: boolean;
  placeholder?: string;
  clearable?: boolean;
  showPassword?: boolean;
  rows?: number;
  autosize?: { minRows?: number; maxRows?: number };
}
export const InputItemAttr: FORMTYPEDATA<InputComponentProps, null> = {
  componentStyle: {
    width: 200,
  },
  // 传给给组件的属性，默认会吧所有的props都传递给控件
  componentProps: {
    type: "text",
    modelValue: null,
    placeholder: "请输入内容",
    maxlength: 20,
    minlength: 0,
    showWordLimit: false,
    clearable: false,
    showPassword: false,
    rows: 2,
    autosize: { minRows: 2, maxRows: 4 },
  },
  // 数据来源
  componentData: null,
  // 是否隐藏
  hidden: false,
  // 组件显隐规则
  hiddenRules: [],
  elFormItemProps: {
    // 是否必选
    required: false,
    error: "",
    showMessage: true,
    inlineMessage: "",
    labelPosition: "",
    rules: [],
  },
};
